import { SceneRange } from "../../scene/map/SceneRange";
import { Dispatcher } from "../../../mvc/core/Dispatcher";
import { EventName } from "../../mvc/EventName";
import { DataEvent } from "../../events/DataEvent";
import { EffectManager } from "../../manager/EffectManager";
import { Cache } from "../../cache/Cache";
import { PathLineDraw } from "../mapUI/PathLineDraw";
import { ModuleType } from "../common/ModuleType";
import { GameManager } from "../../manager/GameManager";
import { TweenMax } from "../../../../com/greensock/TweenMax";
import { Quint } from "../../../../com/greensock/easing/Quint";
import { AStarPoint } from "../../scene/map/AStarPoint";
import { GameMapUtil } from "../../scene/map/GameMapUtil";
import { RolePlayer } from "../../scene/player/entity/RolePlayer";
import { DirectionType } from "../../scene/modle/data/DirectionType";
import { HTMLUtil } from "../../../../com/gengine/utils/HTMLUtil";
import { LoaderManager } from "../../../../com/gengine/resource/LoaderManager";
import { MapFileUtil } from "../../scene/map/MapFileUtil";
import { ImageInfo } from "../../../../com/gengine/resource/info/ImageInfo";
import { Game } from "../../Game";
import { HighlightManager } from "../../manager/HighlightManager";
import { FrameTimer } from "../../../../com/gengine/core/frame/FrameTimer";
import { TimerType } from "../../../../com/gengine/core/frame/TimerType";
import { ObjectPool } from "../../../../com/gengine/utils/pools/ObjectPool";
import { MonsterPlayer } from "../../scene/player/entity/MonsterPlayer";
import { EntityBitmapDatas } from "../mapUI/point/EntityBitmapDatas";
import { TransportPlayer } from "../../scene/player/entity/TransportPlayer";
import { UserPlayer } from "../../scene/player/entity/UserPlayer";
import { Language } from "../../../../extend/language/Language";
import { ParamsConst } from "../../../common/global/ParamsConst";
import { ProxyType } from "../../../common/global/ProxyType";
import { ToolTipsManager } from "../../../../com/mui/manager/ToolTipsManager";
import { FilterConst } from "../../../component/gconst/FilterConst";
import { AIManager } from "../../scene/ai/AIManager";
import { AIType } from "../../scene/ai/AIType";
import { SystemSetter } from "../system/SystemSetter";
import { ModuleTypeTip } from "../common/ModuleTypeTip";
import { GlobalClass } from "../../../../com/mui/core/GlobalClass";
import { GButton } from "../../../../com/mui/controls/GButton";
import { GLabel } from "../../../../com/mui/controls/GLabel";
import { GTextFormat } from "../../../common/GTextFormat";
import { FontUtil } from "../../../common/font/FontUtil";
import { ThingUtil } from "../../scene/layer/utils/ThingUtil";
import { Fu } from "../../../../ModuleType/Fu";
import { Bang } from "../../../../ModuleType/Bang";
import { AllShow } from "../../../../ModuleType/AllShow";
import { AllHide } from "../../../../ModuleType/AllHide";
import { HalfHide } from "../../../../ModuleType/HalfHide";
import { AutoFight } from "../../../../ModuleType/AutoFight";
import { Tu } from "../../../../ModuleType/Tu";
import { Mail } from "../../../../ModuleType/Mail";
import { Sound } from "../../../../ModuleType/Sound";
import { NoSound } from "../../../../ModuleType/NoSound";
import { Friend } from "../../../../ModuleType/Friend";
import { GM } from "../../../../ModuleType/GM";
import { Group } from "../../../../ModuleType/Group";
import { FullScreen } from "../../../../ModuleType/FullScreen";
import { HideEffect } from "../../../../ModuleType/HideEffect";
import { ShowEffect } from "../../../../ModuleType/ShowEffect";
import { Hui } from "../../../../ModuleType/Hui";
type int = number;
//class SmallMap
    
    export  class SmallMap /* flash.display.Sprite */
    {
        constructor()
        {
            
            this._thingLayer = new Object /* flash.display.Sprite */();
            this._miniMapPathSp = new Object /* flash.display.Sprite */();
            this._miniMapRect = new Object /* flash.geom.Rectangle */();
            this._scaleMap = Math.min(this._areaWidth / SceneRange.screenResolutionX, this._areaHeight / SceneRange.screenResolutionY) * 2 / 3;
            this._startPoint = new Object /* flash.geom.Point */();
            this.init();
            Dispatcher.addEventListener(EventName.NoSoundBtnShowOrHide, this.OnShowOrHideNoSoundBtnHandler);
            Dispatcher.addEventListener(EventName.ScreenOrShowPlayer, this.onScreenOrShowPlayerHandler);
            Dispatcher.addEventListener(EventName.SysSettingSuccess, this.SysSettingSuccessHandler);
            Dispatcher.addEventListener(EventName.FirstRechargeTips, this.onFirstRechargeTipsHandler);
            Dispatcher.addEventListener(EventName.GetOpenRechargeGiftBagSuccess, this.onGetOpenRechargeGiftBagSuccessHandler);
            Dispatcher.addEventListener(EventName.DailyGiftInfoRes, this.onDailyGiftInfoResHandler);
            this.mouseEnabled = false;
            return;
        }

        /* internal  */onFirstRechargeTipsHandler(arg1: DataEvent): void
        {
            var loc1=null;
            if (this._fuBtn) 
            {
                loc1 = new Object /* flash.filters.GlowFilter */(16777062, 1, 3, 3, 5);
                EffectManager.glowFilterReg(this._fuBtn, [loc1], 0.5, 10, 5, 0);
            }
            return;
        }

        /* internal  */onGetOpenRechargeGiftBagSuccessHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Array<any>;
            if (this._fuBtn && loc1.length > 0 && Cache.instance.daily.firstPayPackUsed) 
            {
                EffectManager.glowFilterUnReg(this._fuBtn);
            }
            return;
        }

        /* internal  */onDailyGiftInfoResHandler(arg1: DataEvent): void
        {
            if (this._fuBtn && Cache.instance.daily.firstPayPackUsed) 
            {
                EffectManager.glowFilterUnReg(this._fuBtn);
            }
            return;
        }

        public updateSmallMapPath(arg1: Array<any>): void
        {
            if (arg1 == null) 
            {
                return;
            }
            this._currentPath = arg1;
            if (this._mapThumb.bitmapData == null) 
            {
                return;
            }
            PathLineDraw.draw(this._miniMapPathSp, arg1, this._currentPoint, this._scaleX, this._scaleY);
            return;
        }

        public onBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=flash.utils.getQualifiedClassName(arg1.target);
            var loc2=loc1;
            switch (loc2) 
            {
                case ModuleType.Target:
                {
                    GameManager.instance.popupWindow(loc1);
                    break;
                }
            }
            return;
        }

        /* internal  */onShrinkBtnClickHandler(arg1: Object /* flash.events.MouseEvent */): void
        {
            if (this._hasShow) 
            {
                this.hide();
            }
            else 
            {
                this.show();
            }
            return;
        }

        public show(): void
        {
            this._shrinkBtn.styleName = "SmallMapUpButton";
            TweenMax.to(this._mapMain, 0.2, {"y": 0, "ease": Quint.easeOut});
            this._hasShow = true;
            this._mapTop.visible = false;
            return;
        }

        public hide(): void
        {
            this._shrinkBtn.styleName = "SmallMapDownButton";
            TweenMax.to(this._mapMain, 0.2, {"y":-200, "ease": Quint.easeOut});
            this._hasShow = false;
            this._mapTop.visible = true;
            return;
        }

        public updatePoint(arg1: AStarPoint=null): void
        {
            if (arg1 == null) 
            {
                return;
            }
            this._currentPoint = arg1;
            this._pointLabel.text = arg1.x + "·" + arg1.y;
            if (this._mapThumb.bitmapData == null) 
            {
                return;
            }
            this.updateMap(arg1);
            return;
        }

        /* internal  */updateMap(arg1: AStarPoint): void
        {
            var loc1=GameMapUtil.tilePointToLocal(arg1.x, arg1.y, this._scaleX, this._scaleY);
            this._startPoint.x = loc1.x - this._areaWidth / 2;
            this._startPoint.y = loc1.y - this._areaHeight / 2;
            if (this._startPoint.x < 0) 
            {
                this._startPoint.x = 0;
                this._mark.x = loc1.x;
            }
            else if (this._startPoint.x + this._areaWidth > this._mapWidth) 
            {
                this._startPoint.x = this._mapWidth - this._areaWidth;
                this._mark.x = loc1.x;
            }
            else 
            {
                this._mark.x = loc1.x;
            }
            if (this._startPoint.y < 0) 
            {
                this._startPoint.y = 0;
                this._mark.y = loc1.y;
            }
            else if (this._startPoint.y + this._areaHeight > this._mapHeight) 
            {
                this._startPoint.y = this._mapHeight - this._areaHeight;
                this._mark.y = loc1.y;
            }
            else 
            {
                this._mark.y = loc1.y;
            }
            this._miniMapRect.x = this._startPoint.x;
            this._miniMapRect.y = this._startPoint.y;
            this._miniMapLayer.scrollRect = this._miniMapRect;
            if (RolePlayer.instance.isInitInfo == false) 
            {
                return;
            }
            this._mark.rotation = DirectionType.getRotation(RolePlayer.instance.direction);
            return;
        }

        public updateMapName(arg1: string): void
        {
            this._mapnameLabel.htmlText = HTMLUtil.addColor(arg1, "#ffffff");
            return;
        }

        public updateMiniMap(): void
        {
            this.stopThingFrame();
            if (this._mapThumb.bitmapData != null) 
            {
                this._mapThumb.bitmapData.dispose();
                this._mapThumb.bitmapData = null;
            }
            if (this._currentPath != null) 
            {
                this._currentPath.splice(0);
            }
            LoaderManager.instance.load(MapFileUtil.getMiniMapPath(), this.onPicLoad, 3, MapFileUtil.mapID);
            return;
        }

        protected onPicLoad(arg1: ImageInfo): void
        {
            if (arg1) 
            {
                if (int(arg1.extData) == MapFileUtil.mapID) 
                {
                    if (arg1.bitmapData && arg1.bitmapData.height > 0 && arg1.bitmapData.width > 0) 
                    {
                        this._mapThumb.bitmapData = arg1.bitmapData.clone();
                        this.calculateScale();
                    }
                    this.updatePoint(this._currentPoint);
                    this.updateSmallMapPath(this._currentPath);
                    this.startThingFrame();
                }
            }
            return;
        }

        public get mapMain(): Object /* flash.display.MovieClip */
        {
            return this._mapMain;
        }

        public set mapMain(arg1: Object /* flash.display.MovieClip */)
        {
            this._mapMain = arg1;
            return;
        }

        /* internal  */calculateScale(): void
        {
            var loc1;
            this._mapThumb.width = loc1 = Game.sceneInfo.sMapDefine.realWidth / 10;
            this._mapWidth = loc1;
            this._mapThumb.height = loc1 = Game.sceneInfo.sMapDefine.realHeight / 10;
            this._mapHeight = loc1;
            this._scaleX = this._mapWidth / Game.mapInfo.gridWidth;
            this._scaleY = this._mapHeight / Game.mapInfo.gridHeight;
            return;
        }

        public clearLine(): void
        {
            this._miniMapPathSp.graphics.clear();
            return;
        }

        public showMailMask(arg1: Boolean): void
        {
            HighlightManager.instance.flashMaskButton(this.mapMain.getChildByName(ModuleType.Mail), arg1);
            return;
        }

        public showTWHuiMask(arg1: Boolean): void
        {
            HighlightManager.instance.glowEffectButton(this.mapMain.getChildByName(ModuleType.Hui), arg1);
            return;
        }

        /* internal  */startThingFrame(): void
        {
            if (!this._thingFrame) 
            {
                this._thingFrame = new FrameTimer(90);
                this._thingFrame.addListener(TimerType.ENTERFRAME, this.onThingFrame);
            }
            if (!this._thingFrame.running) 
            {
                this._thingFrame.start();
            }
            return;
        }

        /* internal  */stopThingFrame(): void
        {
            if (this._thingFrame && this._thingFrame.running) 
            {
                this._thingFrame.stop();
            }
            return;
        }

        /* internal  */clearThing(): void
        {
            var loc1=null;
            while (this._thingLayer.numChildren > 0) 
            {
                loc1 = this._thingLayer.removeChildAt(0) as Object /* flash.display.Bitmap */;
                ObjectPool.disposeObject(loc1, flash.display.Bitmap);
            }
            return;
        }

        /* internal  */checkEntityList(arg1: Array<any>): void
        {
            var loc1=0;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=null;
            var loc2=arg1.length;
            while (loc1 < loc2) 
            {
                if (!(loc4 = arg1[loc1]) || loc4 is RolePlayer || loc4.isDead) 
                {
                    ++loc1;
                    continue;
                }
                if (typeof loc4 === "monsterplayer") 
                {
                    (loc6 = ObjectPool.getObject(flash.display.Bitmap)).bitmapData = EntityBitmapDatas.getBitmapData(EntityBitmapDatas.boss);
                }
                else if (loc4 is TransportPlayer && loc4.entityInfo.isSelf) 
                {
                    (loc6 = ObjectPool.getObject(flash.display.Bitmap)).bitmapData = EntityBitmapDatas.getBitmapData(EntityBitmapDatas.transport);
                }
                else if (typeof loc4 === "userplayer") 
                {
                    if (Cache.instance.group.entityIsInGroup(loc4.entityInfo.entityInfo.entityId)) 
                    {
                        (loc6 = ObjectPool.getObject(flash.display.Bitmap)).bitmapData = EntityBitmapDatas.getBitmapData(EntityBitmapDatas.group);
                    }
                    else 
                    {
                        (loc6 = ObjectPool.getObject(flash.display.Bitmap)).bitmapData = EntityBitmapDatas.getBitmapData(EntityBitmapDatas.user);
                    }
                }
                if (!(loc6 == null) && !(loc6.bitmapData == null)) 
                {
                    if ((loc5 = GameMapUtil.pixPointToLocal(loc4.x, loc4.y, this._scaleX, this._scaleY)).x > this._startPoint.x && loc5.y < this._startPoint.y + this._areaHeight) 
                    {
                        loc6.x = loc5.x - loc6.width / 2;
                        loc6.y = loc5.y - loc6.height / 2;
                        this._thingLayer.addChild(loc6);
                    }
                }
                ++loc1;
            }
            return;
        }

        /* internal  */OnShowOrHideNoSoundBtnHandler(arg1: DataEvent): void
        {
            var loc1=arg1.data as Boolean;
            if (loc1) 
            {
                this._noSoundBtn.visible = true;
                this._soundBtn.visible = false;
            }
            else 
            {
                this._noSoundBtn.visible = false;
                this._soundBtn.visible = true;
            }
            return;
        }

        /* internal  */regBtnToolTip(): void
        {
            var loc18=null;
            var loc19=null;
            var loc20=null;
            var loc1=Language.getStringByParam(51025, "F9");
            var loc2=Language.getStringByParam(51121, "F9");
            var loc3=Language.getStringByParam(51122, "F9");
            var loc4=Language.getStringByParam(51027, "M");
            var loc5=HTMLUtil.addColor(Language.getString(51028), "#00FF00");
            var loc6=Language.getStringByParam(51029, "I");
            var loc7=Language.getStringByParam(51030, "P");
            var loc8=Language.getStringByParam(51031, "A");
            var loc9=Language.getStringByParam(51033, "E");
            var loc10=Language.getStringByParam(51034, "F8");
            var loc11=Language.getStringByParam(51035, "Y");
            var loc12=Language.getStringByParam(51113, "T");
            var loc13=Language.getStringByParam(51117, "F");
            var loc14=Language.getString(51137);
            var loc15=Language.getString(33005);
            var loc16=[{"name": Fu, "value": loc6}, {"name": Bang, "value": loc7}, {"name": AllShow, "value": loc1}, {"name": AllHide, "value": loc2}, {"name": HalfHide, "value": loc3}, {"name": AutoFight, "value": loc8}, {"name": Tu, "value": loc4}, {"name": Mail, "value": loc9}, {"name": Sound, "value": loc5}, {"name": NoSound, "value": loc5}, {"name": Friend, "value": loc13}, {"name": GM, "value":"GM"}, {"name": Group, "value": loc12}, {"name": FullScreen, "value": loc10}, {"name": HideEffect, "value": loc14}, {"name": ShowEffect, "value": loc15}];
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                loc16.push({"name": Hui, "value":"聚仙會"});
            }
            var loc17=0;
            while (loc17 < loc16.length) 
            {
                loc20 = (loc18 = loc16[loc17]).name as string;
                (loc19 = this._mapMain.getChildByName(loc20) as Object /* flash.display.SimpleButton */).addEventListener(flash.events.MouseEvent.MOUSE_OVER, this.onBtnMouseOver);
                loc19.addEventListener(flash.events.MouseEvent.MOUSE_OUT, this.onBtnMouseOut);
                if (loc20 == ModuleType.Sound || loc20 == ModuleType.NoSound || loc20 == ModuleType.GM || loc20 == ModuleType.FullScreen || loc20 == ModuleType.HideEffect || loc20 == ModuleType.ShowEffect) 
                {
                    ToolTipsManager.register(loc19, null, HTMLUtil.addColor(loc18.value as string, "#FFFFFF"));
                }
                ++loc17;
            }
            return;
        }

        /* internal  */onBtnMouseOver(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as Object /* flash.display.SimpleButton */;
            loc1.filters = [FilterConst.uiBtnFilter];
            return;
        }

        /* internal  */onMiniMapClick(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            if (!(this._currentPoint == null) && !(this._mapThumb.bitmapData == null)) 
            {
                loc1 = new Object /* flash.geom.Point */(arg1.localX - 10, arg1.localY - 5);
                loc2 = new Object /* flash.geom.Point */(loc1.x + this._startPoint.x, loc1.y + this._startPoint.y);
                loc3 = GameMapUtil.localToTilePoint(loc1.x + this._startPoint.x, loc1.y + this._startPoint.y, 1 / this._scaleX, 1 / this._scaleY);
                AIManager.onAIControl(loc3, AIType.AI_Scene);
            }
            return;
        }

        /* internal  */onBtnMouseOut(arg1: Object /* flash.events.MouseEvent */): void
        {
            var loc1=arg1.target as Object /* flash.display.SimpleButton */;
            loc1.filters = [];
            return;
        }

        /* internal  */onScreenOrShowPlayerHandler(arg1: DataEvent): void
        {
            this.showButtons();
            return;
        }

        /* internal  */showButtons(): void
        {
            if (SystemSetter.localSetter.hideModel) 
            {
                SystemSetter.hideType = 1;
                this._allShowBtn.visible = true;
                this._allHideBtn.visible = false;
                this._halfHideBtn.visible = false;
            }
            else if (SystemSetter.localSetter.hideNearPlayerPet) 
            {
                SystemSetter.hideType = 0;
                this._allShowBtn.visible = false;
                this._allHideBtn.visible = false;
                this._halfHideBtn.visible = true;
            }
            else 
            {
                SystemSetter.hideType = 2;
                this._allShowBtn.visible = false;
                this._allHideBtn.visible = true;
                this._halfHideBtn.visible = false;
            }
            if (SystemSetter.localSetter.hideLightAndEffect) 
            {
                this._hideEffectBtn.visible = true;
                this._showEffectBtn.visible = false;
            }
            else if (!SystemSetter.localSetter.hideLightAndEffect) 
            {
                this._hideEffectBtn.visible = false;
                this._showEffectBtn.visible = true;
            }
            return;
        }

        public updateShortcutKey(arg1: Array<any>): void
        {
            var loc1=null;
            var loc2=null;
            var loc3=null;
            var loc4=null;
            var loc5=null;
            var loc6=0;
            while (loc6 < arg1.length) 
            {
                loc1 = arg1[loc6];
                if (typeof loc1.key === "string") 
                {
                    loc2 = loc1.key as string;
                    if (loc2 != ModuleType.HidePlayerPet) 
                    {
                        if (loc4 = this._mapMain.getChildByName(loc2) as Object /* flash.display.SimpleButton */) 
                        {
                            if (loc1.keyData) 
                            {
                                if ((loc5 = loc1.keyData.shortcutsName) == "") 
                                {
                                    loc3 = HTMLUtil.addColor(ModuleTypeTip.instance.getTip(loc2, ""), "#FFFFFF");
                                }
                                else 
                                {
                                    loc3 = HTMLUtil.addColor(ModuleTypeTip.instance.getTip(loc2, "（" + loc5 + "）"), "#FFFFFF");
                                }
                            }
                            else 
                            {
                                loc3 = null;
                            }
                            ToolTipsManager.register(loc4, null, loc3);
                        }
                    }
                    else 
                    {
                        if (loc1.keyData) 
                        {
                            loc5 = loc1.keyData.shortcutsName;
                        }
                        loc4 = this._mapMain.getChildByName(ModuleType.AllShow) as Object /* flash.display.SimpleButton */;
                        loc3 = HTMLUtil.addColor(Language.getStringByParam(51025, loc5), "#FFFFFF");
                        ToolTipsManager.register(loc4, null, loc3);
                        loc4 = this._mapMain.getChildByName(ModuleType.AllHide) as Object /* flash.display.SimpleButton */;
                        loc3 = HTMLUtil.addColor(Language.getStringByParam(51121, loc5), "#FFFFFF");
                        ToolTipsManager.register(loc4, null, loc3);
                        loc4 = this._mapMain.getChildByName(ModuleType.HalfHide) as Object /* flash.display.SimpleButton */;
                        loc3 = HTMLUtil.addColor(Language.getStringByParam(51122, loc5), "#FFFFFF");
                        ToolTipsManager.register(loc4, null, loc3);
                    }
                }
                ++loc6;
            }
            return;
        }

        public init(): void
        {
            this._mapTop = GlobalClass.getInstance("MapTop") as Object /* flash.display.MovieClip */;
            this._mapTop.mouseEnabled = false;
            this.addChild(this._mapTop);
            this._mapMain = GlobalClass.getInstance("MapMain") as Object /* flash.display.MovieClip */;
            this._mapMain.x = -3;
            this._mapMain.mouseEnabled = false;
            this._mapMain.y = 0;
            this.addChild(this._mapMain);
            this._shrinkBtn = new GButton();
            this._shrinkBtn.setSize(13, 19);
            this._shrinkBtn.label = "";
            this._shrinkBtn.styleName = "SmallMapUpButton";
            this._shrinkBtn.x = -20;
            this._shrinkBtn.y = 5;
            this._shrinkBtn.addEventListener(flash.events.MouseEvent.CLICK, this.onShrinkBtnClickHandler);
            this.addChild(this._shrinkBtn);
            this._mapnameLabel = new GLabel();
            this._mapnameLabel.text = "";
            this._mapnameLabel.x = -140;
            this._mapnameLabel.y = 3;
            this._mapnameLabel.textField.filters = [FilterConst.nameGlowFilter];
            this._mapnameLabel.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._mapnameLabel.setStyle("textFormat", new GTextFormat(FontUtil.songtiName, 12, 16777215));
            this.addChild(this._mapnameLabel);
            this._mapThumb = new Object /* flash.display.Bitmap */();
            this._miniMapLayer = this._mapMain.getChildByName("miniMapLayer") as Object /* flash.display.MovieClip */;
            this._miniMapLayer.addChild(this._mapThumb);
            this._miniMapLayer.addChild(this._miniMapPathSp);
            this._miniMapLayer.addChild(this._thingLayer);
            this._miniMapLayer.mouseEnabled = false;
            this._miniMapClickLayer = this._mapMain.getChildByName("clickLayer") as Object /* flash.display.MovieClip */;
            this._miniMapClickLayer.addEventListener(flash.events.MouseEvent.CLICK, this.onMiniMapClick, false, 0, true);
            this._mark = GlobalClass.getInstance("RolePosition") as Object /* flash.display.MovieClip */;
            this._miniMapLayer.addChild(this._mark);
            this._pointLabel = new GLabel();
            this._pointLabel.text = "";
            this._pointLabel.textField.filters = [FilterConst.glowFilter];
            this._pointLabel.autoSize = flash.text.TextFieldAutoSize.CENTER;
            this._pointLabel.setStyle("textFormat", new GTextFormat(FontUtil.songtiName, 12, 16580298));
            this._pointLabel.x = -120;
            this._pointLabel.y = 90;
            this._pointLabel.mouseEnabled = false;
            this._pointLabel.mouseChildren = false;
            this._mapMain.addChild(this._pointLabel);
            this._miniMapRect.width = this._areaWidth;
            this._miniMapRect.height = this._areaWidth;
            this._noSoundBtn = this._mapMain.getChildByName(ModuleType.NoSound) as Object /* flash.display.SimpleButton */;
            this._noSoundBtn.visible = false;
            this._soundBtn = this._mapMain.getChildByName(ModuleType.Sound) as Object /* flash.display.SimpleButton */;
            this._allShowBtn = this._mapMain.getChildByName(ModuleType.AllShow) as Object /* flash.display.SimpleButton */;
            this._allShowBtn.visible = true;
            this._allHideBtn = this._mapMain.getChildByName(ModuleType.AllHide) as Object /* flash.display.SimpleButton */;
            this._allHideBtn.visible = false;
            this._halfHideBtn = this._mapMain.getChildByName(ModuleType.HalfHide) as Object /* flash.display.SimpleButton */;
            this._halfHideBtn.visible = false;
            this._hideEffectBtn = this._mapMain.getChildByName(ModuleType.HideEffect) as Object /* flash.display.SimpleButton */;
            this._showEffectBtn = this._mapMain.getChildByName(ModuleType.ShowEffect) as Object /* flash.display.SimpleButton */;
            if (ParamsConst.instance.proxyType == ProxyType.TW) 
            {
                this._twHuiBtn = this._mapMain.getChildByName(ModuleType.Hui) as Object /* flash.display.SimpleButton */;
            }
            this._fuBtn = this._mapMain.getChildByName(ModuleType.Fu) as Object /* flash.display.SimpleButton */;
            this.initShowBtn();
            this.regBtnToolTip();
            return;
        }

        /* internal  */initShowBtn(): void
        {
            this.showButtons();
            if (!ParamsConst.instance.isShowTWHui || !(ParamsConst.instance.proxyType == ProxyType.TW)) 
            {
                if (this._twHuiBtn) 
                {
                    this._twHuiBtn.visible = false;
                }
            }
            return;
        }

        /* internal  */SysSettingSuccessHandler(arg1: DataEvent): void
        {
            this.initShowBtn();
            return;
        }

        /* internal  */onThingFrame(arg1: FrameTimer): void
        {
            this.clearThing();
            var loc1=ThingUtil.entityUtil.getEntityByRangle(SceneRange.display, 0, false);
            this.checkEntityList(loc1);
            return;
        }

        /* internal */ /* var */_mapTop: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_mapMain: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_shrinkBtn: GButton;

        /* internal */ /* var */_pointLabel: GLabel;

        /* internal */ /* var */_mapnameLabel: GLabel;

        /* internal */ /* var */_mark: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_award: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_soundBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_allShowBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_allHideBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_halfHideBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_twHuiBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_fuBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_hideEffectBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_showEffectBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_hasShow: Boolean=true;

        /* internal */ /* var */_miniMapClickLayer: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_miniMapLayer: Object /* flash.display.MovieClip */;

        /* internal */ /* var */_thingLayer: Object /* flash.display.Sprite */;

        /* internal */ /* var */_miniMapPathSp: Object /* flash.display.Sprite */;

        /* internal */ /* var */_thingFrame: FrameTimer;

        /* internal */ /* var */_areaWidth: int=127;

        /* internal */ /* var */_areaHeight: int=127;

        /* internal */ /* var */_miniMapRect: Object /* flash.geom.Rectangle */;

        /* internal */ /* var */_mapThumb: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_scaleX: number=0;

        /* internal */ /* var */_scaleY: number=0;

        /* internal */ /* var */_mapWidth: int;

        /* internal */ /* var */_mapHeight: int;

        /* internal */ /* var */_startPoint: Object /* flash.geom.Point */;

        /* internal */ /* var */_noSoundBtn: Object /* flash.display.SimpleButton */;

        /* internal */ /* var */_currentPoint: AStarPoint;

        /* internal */ /* var */_currentPath: Array<any>;

        /* internal */ /* var */_scaleMap: number;
    }
